package com.mapproject.industrymap.service.impl;

import com.mapproject.industrymap.mapper.BaseInfoMapper;
import com.mapproject.industrymap.service.GeojsonTransforPgService;
import com.mapproject.industrymap.service.SysUploadFileService;
import com.mapproject.industrymap.utils.DataItemGeojson;
import com.mapproject.industrymap.utils.UnZipFile;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

@Service
public class GeojsonTransforPgServiceImpl implements GeojsonTransforPgService {
    @Autowired
    SysUploadFileService sysUploadFileService;
    @Autowired
    UnZipFile unZipFile;
    @Autowired
    BaseInfoMapper baseInfoMapper;
    @Value("${file.uploadFolder}")
    private String uploadFolder;
    @Value("${file.projectFileDir}")
    private String projectFileDir;

    @Override
    public  String uploadInsertGeojsonData(String tableName,String fileName){

        String uploadPath=projectFileDir;
        String filePath = uploadFolder+uploadPath+fileName+"/"+fileName+".geojson";//文件地址
        DataItemGeojson dataItemGeojson=new DataItemGeojson();
        return dataItemGeojson.GeojsonToPG(tableName,fileName,filePath);
    }


}
